<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title></title>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all"/>
    <style>
        .layui-form-item .layui-input-inline {
            width: 150px;
        }
        .layui-form-label {
            padding: 9px 5px;
            width: auto;
        }
        .layui-form-item .layui-inline{
            margin-right:0px;
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">

        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">操作人ID</label>
                    <div class="layui-input-inline">
                        <input type="text" name="adminid" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">内容</label>
                    <div class="layui-input-inline">
                        <input type="text" name="title" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">被操作人ID</label>
                    <div class="layui-input-inline">
                        <input type="text" name="uid" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">被操作人昵称</label>
                    <div class="layui-input-inline">
                        <input type="text" name="nick_name" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">时间范围</label>
                    <div class="layui-input-inline" style="width: 350px;">
                        <input type="text" name="start_time" placeholder="开始时间" autocomplete="off" class="layui-input" style="width: 167px;display: inline" id="start_time_input">
                        -
                        <input type="text" name="end_time" placeholder="截止时间" autocomplete="off" class="layui-input" style="width: 167px;display: inline" id="end_time_input">
                    </div>
                </div>

                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-pushlist" lay-submit lay-filter="LAY-adminlog-front-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>


        <div class="layui-card-body">
            <table id="LAY-adminlog-manage" lay-filter="LAY-adminlog-manage"></table>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: "/layuiadmin/"
        , version: "{:config('other.ui_version')}"
    }).extend({
        index: "lib/index", //主入口模块
    }).use(["index", "adminlog", "table", "laydate"], function () {
        var $ = layui.$,
            form = layui.form
            , laydate = layui.laydate
            , table = layui.table;

        //执行一个laydate实例
        laydate.render({
            elem: '#start_time_input',
            type: 'datetime'
        });
        laydate.render({
            elem: '#end_time_input',
            type: 'datetime'
        });

        table.on("sort(LAY-adminlog-manage)", function (obj) {
            table.reload("LAY-adminlog-manage", {
                initSort: obj, //记录初始排序，如果不设的话，将无法标记表头的排序状态。 layui 2.1.1 新增参数
                where: {
                    //请求参数（注意：这里面的参数可任意定义，并非下面固定的格式）
                    field: obj.field, //排序字段   在接口作为参数字段  field order
                    order: obj.type, //排序方式   在接口作为参数字段  field order
                },
            });
        });


        //监听搜索
        form.on('submit(LAY-adminlog-front-search)', function (data) {
            var field = data.field;

            //执行重载
            table.reload('LAY-adminlog-manage', {
                where: field,
                page: {
                    curr: 1   //默认从第一页开始搜索
                },
            });
        });
    });
</script>
</body>
</html>
